package thesis.database;

import java.util.Date;
import java.util.List;

import javax.sql.DataSource;

public interface UserDAO {

	/**
	 * This is the method to be used to initialize database resources ie.
	 * connection.
	 */
	public void setDataSource(DataSource ds);

	/**
	 * This is the method to be used to create a record in the User table.
	 */
	public int create(User user);

	/**
	 * This is the method to be used to list down a record from the User table
	 * corresponding to a passed User id.
	 */
	public User getUser(Integer id);

	/**
	 * This is the method to be used to list down all the records from the User
	 * table.
	 */
	public List<User> listUsers();

	/**
	 * This is the method to be used to delete a record from the User table
	 * corresponding to a passed User id.
	 */
	public int delete(Integer id);

	/**
	 * This is the method to be used to update a record into the Customer table.
	 */
	public int update(User user);

	/**
	 * This is the method to be used to get user by username.
	 */
	public User getUserByUsername(String userName);

	public List<User> getListUserByName(String name);

}
